package com.situ.controller;

import com.situ.domain.vo.BussinessReportVO;
import com.situ.service.ReportService;
import com.situ.utils.Result;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletResponse;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/report")
@RequiredArgsConstructor
@Tag(name = "报表接口")
public class ReportController {

    private final ReportService reportService;

    @GetMapping("/getBusinessReport")
    @Operation(summary = "查询报表")
    public Result<BussinessReportVO> getBusinessReport() {
        BussinessReportVO businessReport = reportService.getBusinessReport();
        return Result.success(200, "查询成功", businessReport);
    }


    @GetMapping("/getBusinessReportExcel")
    @Operation(summary = "导出报表")
    public void getBusinessReportExcel (HttpServletResponse response) {
        reportService.getBusinessReportExcel(response);
    }

}
